#pragma once

#include "HashTable.h"

namespace chen
{
	template<class K>
	class set
	{
		struct SetOfKey
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};

	public:
		 	//template<class K, class T, class KeyOf, class hashfunc = DefaultHashFunc<K>>
		typedef typename hash_bucket::HashTable<K, K, SetOfKey>::const_iterator iterator;
		typedef typename hash_bucket::HashTable<K, K, SetOfKey>::const_iterator const_iterator;


		const_iterator begin() const
		{
			return _t.begin();
		}

		const_iterator end() const
		{
			return _t.end();
		}

		pair<iterator, bool> insert(const K& key)
		{
			pair<typename hash_bucket::HashTable<K, K, SetOfKey>::iterator, bool> it =  _t.Insert(key);
			return pair<iterator, bool>(it.first, it.second);
		}

	private:
		hash_bucket::HashTable<K, K, SetOfKey> _t;
	};
};